package com.libui.webview

import android.graphics.Bitmap
import android.os.Message
import com.libui.navigatonbar.MenuData
import com.tencent.smtt.export.external.interfaces.WebResourceError
import com.tencent.smtt.export.external.interfaces.WebResourceRequest
import com.tencent.smtt.export.external.interfaces.WebResourceResponse
import com.tencent.smtt.sdk.WebView

interface WebViewDelegate {
    fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean

    fun onPageStarted(var1: WebView, var2: String?, var3: Bitmap?)

    fun onPageFinished(var1: WebView, var2: String?)

    fun onReceivedError(
        webView: WebView,
        webResourceRequest: WebResourceRequest?,
        webResourceError: WebResourceError?
    )

    fun onReceivedHttpError(
        webView: WebView,
        webResourceRequest: WebResourceRequest?,
        webResourceResponse: WebResourceResponse?
    )

    fun onCreateWindow(
        webView: WebView,
        isDialog: Boolean,
        isUserGesture: Boolean,
        resultMsg: Message
    ): Boolean

    fun onCloseWindow(webView: WebView)

    fun setRightMenus(webView: WebView, menus: List<MenuData>?)
}